;(function(){
    window.onload = function(){
       slideObj();
    };
    function slideObj(){
        //点击图片放大效果
        var maskLay = document.createElement("div");
        var maskLayImg = document.createElement("img");
        var closBtn = (function(){
            var svgns = "http://www.w3.org/2000/svg";
            var svgElm = document.createElementNS(svgns,"svg");
            var path1 = document.createElementNS(svgns,"line");
            var path2 = document.createElementNS(svgns,"line");
            var setAttr = function(elem,attr){
                for(name in attr){
                    elem.setAttribute(name,attr[name]);
                }
            };
            setAttr(svgElm,{
                viewBox : "0 0 20 20",
                width : "20",
                height : "20",
                fill : "#333"
            });
            setAttr(path1,{
                x1 : 0,
                y1 : 0,
                x2 : 20,
                y2 : 20,
            });
            setAttr(path2,{
                x1 : 20,
                y1 : 0,
                x2 : 0,
                y2 : 20
            });
            path1.style.cssText = path2.style.cssText ="stroke:rgba(150,150,150,.7);stroke-width:2";
            svgElm.appendChild(path1);
            svgElm.appendChild(path2);
            svgElm.style.cssText = "position:absolute;width:6%;height:6%;top:0;right:2%;z-index:20000;";
            return svgElm;
        })();
        maskLay.appendChild(closBtn);
        maskLayImg.style.width = "70%";
        maskLayImg.src = "./images/code.jpg";
        maskLayImg.style.position = "absolute";
        maskLayImg.style.left = "15%";
        maskLayImg.style.top = "25%";
        maskLay.appendChild(maskLayImg);
        maskLay.style.backgroundColor = "rgba(0,0,0,0.7)";
        maskLay.style.width = "100%";
        maskLay.style.height = window.innerHeight + "px";
        maskLay.style.display = "block";
        maskLay.style.position = "fixed";
        maskLay.style.display = "none";
        maskLay.style.zIndex = 1000;
        maskLay.style.top = "0px";
        maskLay.style.border = "10px solid rgba(0,0,0,0.7)";
        maskLay.style.boxSizing = "border-box";
        document.body.appendChild(maskLay);
        maskLay.onclick = function(){
            maskLay.style.display = "none";
            return false;
        };
        maskLayImg.onclick = function(e){
            e.stopPropagation();
        }
        document.getElementById("show2dCode").onclick = function(e){
            maskLay.style.display = "block";
        };
    }
})();